<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<title><?= $event_data['name'] ?></title>

<link href="__PUBLIC__/plugins/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/themes/global/global.css" rel="stylesheet">
<link href="__PUBLIC__/themes/wechat/treasure/style.css" rel="stylesheet">
<link href="__PUBLIC__/themes/wechat/treasure/patch.css" rel="stylesheet">
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="__PUBLIC__/plugins/jquery/2.1.3/jquery.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/wechat/treasure/result.js"></script>
<script>
var Param = <?= json_encode($param) ?> ;
$(function(){
  Result.init(<?= json_encode($config) ?>);
});

var share_data = <?= json_encode($share_data) ?> ;
wx.config({
    debug   : false ,
    appId   : '<?= $wx_js_config["appid"] ?>' ,
    timestamp: <?= $wx_js_config["timestamp"] ?>,
    nonceStr: '<?= $wx_js_config["noncestr"] ?>',
    signature: '<?= $wx_js_config["signature"] ?>',
    jsApiList: [
      'onMenuShareTimeline' ,
      'onMenuShareAppMessage',
      'onMenuShareQQ' ,
      'onMenuShareWeibo'
    ]
});

wx.ready(function () {
  wx.onMenuShareTimeline({
    title : share_data.title, // 分享标题
    link  : share_data.link, // 分享链接
    desc  : share_data.desc , // 分享描述
    imgUrl: share_data.icon, // 分享图标
    success: function () { 
      // 用户确认分享后执行的回调函数
      //alert( share_data.link);
    },
    cancel: function () { 
      //用户取消分享后执行的回调函数
    }
  });
  
  wx.onMenuShareAppMessage({
    title: share_data.title, // 分享标题
    desc : share_data.desc , // 分享描述
    link : share_data.link, // 分享链接
    imgUrl:  share_data.icon, // 分享图标
    type: 'link', // 分享类型,music、video或link，不填默认为link
    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
    success: function () { 
      // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
      // 用户取消分享后执行的回调函数
    }
  });
      
  wx.onMenuShareQQ({
    title: share_data.title, // 分享标题
    desc: share_data.desc, // 分享描述
    link: share_data.link, // 分享链接
    imgUrl: share_data.icon, // 分享图标
    success: function () { 
      // 用户确认分享后执行的回调函数
      //alert(share_data.url);
    },
    cancel: function () { 
      // 用户取消分享后执行的回调函数
    }
  });
  wx.onMenuShareWeibo({
    title: share_data.title, // 分享标题
    desc: share_data.desc, // 分享描述
    link: share_data.link , // 分享链接
    imgUrl: share_data.icon , // 分享图标
    success: function () { 
      // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
      // 用户取消分享后执行的回调函数
    }
  });
});
</script>
</head>
<body>

<div class="container result">
  <!-- 
  <a href="#" id="test_goods_btn">测试goods</a>
  <a href="#" id="test_bad_btn">测试bad</a>
  -->
  <div class="result-icon-line">
    <img src="<?= $my_data['header_icon'] ?>" title="icon">
  </div>
  
  <div class="result-crown-line">
    <img src="__PUBLIC__/themes/wechat/treasure/images/result_crown.png">
  </div>
  
  <div class="result-name-line">
    <?= $my_data['user_nickname'] ?>
  </div>
  
  <div class="result-point-line">
    <?= $my_data['point'] ?>
  </div>
  
  <div class="result-list-line">
    <div class="list-data">
      <table>
        <?php foreach( $assist_data as $row ) :?>
        <tr>
          <td width="10%"><img src="<?= $row['icon'] ?>"></td>
          <td width="30%"><?= $row['nickname'] ?></td>
          <td width="50%"><?= substr($row['create_time'] , 0 , 16 ) ?></td>
          <td><?= $row['point'] ?></td>
        </tr>
        <?php endforeach ; ?>
      </table>
    </div>
  </div>
  
  <div class="result-take-line">
    <a href="<?= $config['rule_url'] ?>" class="img-btn result-exchange-btn">我要兑换</a>
  </div>
  
  <div class="result-btn-line">
    <a id="assist_btn" href="<?= $config['do_assist_url'] ?>" class="img-btn result-assist-btn">帮TA挖宝</a>
    <a id="share_btn" href="#" class="img-btn result-share-btn">邀请伙伴</a>
    <a href="http://mp.weixin.qq.com/s?__biz=MjM5NTQzNzM1Mw==&mid=214867265&idx=3&sn=6504d316a112cedfb4143b37cc40153c#rd" class="img-btn result-play-btn">我也要挖</a>
  </div>
</div>
<div id="good_card_modal" class="good-card-modal">
  <a class="close-btn" href="#">X</a>
  <div id="good_point" class="point">12</div>
</div>

<div id="bad_card_modal" class="bad-card-modal">
  <a class="close-btn" href="#">X</a>
  <div id="bad_point" class="point">12</div>
</div>

<div id="share_modal" class="share-modal">
  <img src="__PUBLIC__/themes/wechat/treasure/images/share_arrow.png">
</div>
</body>
</html>